home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / gems / gemsiii.lha / gemsIII / luminaire / sphere_luminaire.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-20  |  910 b   |  30 lines

  1. // ******************************************************************
  2. //
  3. // Physically Correct Direct Lighting For DistribOAution Ray Tracing
  4. //             by Changyaw Wang
  5. //
  6. // sphere_luminaire.h
  7. //
  8. // ******************************************************************
  9.  
  10. class sphere : public geom_obj {
  11. public:
  12.     point center;
  13.     double radius;
  14.  
  15.     void hit(const point& x,   // viewpoint
  16.          const vector& v,  // viewing direction
  17.          const point on_light);   // hit point
  18.          
  19.     // Selects a point visible from x given (r1,r2).  
  20.     // Here, visible means not SELF-shadowed.
  21.  
  22.     virtual void select_visible_point(
  23.              const point& x,   // viewpoint
  24.              const double r1,  // random number
  25.              const double r2,  // random number
  26.              point& on_light,  // point corresponding to (r1,r2)
  27.              double& prob);    // probability of selecting on_light
  28. };
  29.  
  30.